package cn.as142.controller;

import cn.as142.pojo.Teacher;
import cn.as142.pojo.Users;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Author XiaoMo
 * @Date 2022/3/3 9:58
 * @Version 1.0
 */
@Controller
public class HelloController {

    @Resource //从spring的ioc容器获取对象
    private Teacher teacher;

    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello "+teacher.getTeacherName();
    }
}
